package Data;

import Logic.Settings;

/**
 * A class which represents a single player in the game.
 * A player is represented by an ID and a name, and has an army of characters
 * which he uses to play the game.
 */
public class Player 
{
	private Character[] army;
	private String name;
	private Integer id = null;
	
	/**
	 * Constructs a new Player instance.
	 * 
	 * @param name
	 * @param id
	 */
	public Player(String name, Integer id)
	{
		this.name = name;
		this.id = id;
		
		army = new Character[Settings.getArmySize()];
	}
	
	public Player(String name)
	{
		this(name, null);
	}
	
	public Player(int id)
	{
		this("Default Name", id);
	}
	
	public Player()
	{
		this("Default Name");
	}
	
	public void setArmy(Character creature, int index)
	{
		army[index] = creature;
	}
	
	public Character[] getArmy()
	{
		return army;
	}
	
	public String getName()
	{
		return name;
	}
	
	public void setName(String name)
	{
		this.name = name;
	}
	
	public Integer getId()
	{
		return id;
	}
	
	public void setId(int id)
	{
		this.id = id;
	}
	
}
